<template>
  <div>
    <div class="student-item" v-for="(item, index) in studentList" :key="index">
      <div class="avatar"><img :src="item.head_sculpture" alt="" width="100%"></div>
      <div class="user" @click="$router.push({path: '/studentSign', query: {data: JSON.stringify(item)}})">
        <div class="name" >
          <p class="nickname">{{ item.name }}签到记录</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import api from '@/api'
export default {
  name: 'index',
  data () {
    return {
      studentList: []
    }
  },
  mounted () {
    this.curriculum_vip()
  },
  methods: {
    // vip一对一课程 agencyCurriculumVvip
    curriculum_vip () {
      let params = {
        // mechanism_id: JSON.parse(sessionStorage.getItem('user')).id
        mechanism_id: JSON.parse(sessionStorage.getItem('user')).id
      }
      api.agencyCurriculumVvip({
        params,
        callback: res => {
          console.log(res)
          this.studentList = res.data.data
        }
      })
    }

  }
}
</script>

<style scoped>
  .student-item{
    height: 70px;
    display: flex;
    padding: 0 0 0 15px;
    align-items: center;
  }
  .student-item .avatar{
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    flex-grow: 0;
    margin-right: 20px;
  }
  .student-item .user{
    flex-shrink: 1;
    flex-grow: 1;
    border-bottom: 1px solid #999;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
</style>
